import { Editor } from "./Editor";
export * from "./Editor";
export function useEditor(options: { canvas: HTMLCanvasElement }) {
  const { canvas } = options;
  const editor = new Editor(canvas);
  const use = (plugin: EditorPlugin) => {
    plugin.install(editor);
  };
  const animate = () => {
    editor.render();
    requestAnimationFrame(animate);
  };
  return {
    use,
    animate,
  };
}
